package org.magento.basic;

import java.util.concurrent.TimeUnit;

import org.magento.data.AdminData;
import org.magento.data.CustomerData;
import org.magento.data.DefaultProduct;
import org.magento.data.NewCustomerData;
import org.magento.utils.ConfigProperties;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
/*This is parent class for all test case
 * 
 */

public class BasicTestCase {
	
	protected static WebDriver driver;
	
	
	// Data: 
	public AdminData admin = new AdminData ("Admin", "test12345", "denis.ulyanov@iceshop.nl");
	public CustomerData customer = new CustomerData("denis.ulyanov@iceshop.nl", "test12345", "Denis", "Ulyanov", 
			"ICEshop", "Oudeshanse 30A", "Amsterdam", "1234 AB", "Netherlands", "+01234567890", "Denis Ulyanov", 
			"Visa", "1234567812345678",
			"01 - January", "2020", "123");
	public NewCustomerData newCustomer = new NewCustomerData("John", "Smith", "john.smith@batavi.org", "test12345");
	public DefaultProduct defaultProduct = new DefaultProduct("PM26 SPORT HORLOGE");
	
	//Initializing driver
	protected WebDriver getWebDriver() {
		if  (driver == null) {
			 driver = new FirefoxDriver();
			 driver.manage().timeouts().implicitlyWait(Long.parseLong(ConfigProperties.getProperty("imp.wait")), TimeUnit.SECONDS);
		}
		return driver;
	}
	
	@AfterTest
	//Close browser
	public void tearDown() throws Exception {
		driver.quit();
	}

}
